/*
 * Author  : Leo <lipf160627@163.com>
 * Created : 2025-7-27
 * Desc    : Components
 */

#include "components.hpp"

#include <memory>

#include "config.hpp"

Components::Components()
{
    // 创建Asrpro对象
    asrpro = std::make_shared<Asrpro>(ASRPRO_UART_NUM, ASRPRO_TX_PIN, ASRPRO_RX_PIN, ASRPRO_UART_BAUDRATE);
    // 创建CoMcu对象
    coMcu = std::make_shared<CoMcu>(CO_MCU_UART_NUM, CO_MCU_TX_PIN, CO_MCU_RX_PIN, CO_MCU_UART_BAUDRATE);
    // 创建LCD对象
    lcd = std::make_shared<Lcd>(LCD_SPI_HOST, LCD_CLK_PIN, LCD_MOSI_PIN, LCD_RST_PIN, LCD_DC_PIN, LCD_CS_PIN, LCD_BLK_PIN);
    // 创建LED对象
    led = std::make_shared<Led>(LED_FRONT_LEFT_PIN, LED_FRONT_RIGHT_PIN, LED_BACK_LEFT_PIN, LED_BACK_RIGHT_PIN, LED_ON_LEVEL);
    // 创建Ultrasonic对象
    ultrasonic = std::make_shared<Ultrasonic>(ULTRASONIC_TRIG_PIN, ULTRASONIC_ECHO_PIN);
}
